import { defineStore } from 'pinia'
import { reactive,onMounted } from 'vue'
import { getCategoryAPI } from '@/apis/layout'

export  const useCategoryStore = defineStore('catrgory',() => {
    const categoryList = reactive([])

    const getCategory = async () => {
            const {result} = await getCategoryAPI()
            Object.assign(categoryList,result)
    }
    
    onMounted(() => {
        getCategory()
    })


    return {categoryList,getCategory}
})